package com.prd.controller;

import com.prd.model.EntMeetRecord;
import com.prd.service.EntMeetRecordService;
import com.prd.util.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = {"会议记录"})
@RestController
@RequestMapping("/api/entMeetRecord")
public class EntMeetRecordController extends BaseController {

    @Autowired
    private EntMeetRecordService entMeetRecordService;


    @ApiOperation("会议记录审核确认")
    @PostMapping(value = "checkRecord/{recordId}", produces = "application/json;charset=UTF-8")
    public AjaxResult checkRecord(@PathVariable Long recordId) {
        return toAjax(entMeetRecordService.checkRecord(recordId));
    }

    @ApiOperation("修改会议记录")
    @PostMapping(value = "updateRecord", produces = "application/json;charset=UTF-8")
    public AjaxResult updateRecord(@RequestBody EntMeetRecord entMeetRecord) {
        return toAjax(entMeetRecordService.updateRecord(entMeetRecord));
    }

    @ApiOperation("删除会议记录")
    @PostMapping(value = "deleteRecord/{id}", produces = "application/json;charset=UTF-8")
    public AjaxResult deleteRecord(@PathVariable Long id) {
        return toAjax(entMeetRecordService.removeById(id));
    }

    @ApiOperation("需执行会议记录")
    @PostMapping(value = "executeRecord/{id}", produces = "application/json;charset=UTF-8")
    public AjaxResult executeRecord(@PathVariable Long id) {
        return toAjax(entMeetRecordService.executeRecord(id));
    }

}
